﻿<navigation:Page xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="GranitePackageSystem.Views.Request.TestingDetails" 
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
           xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
           xmlns:GranitePackageSystem_FileUploader="clr-namespace:GranitePackageSystem.FileUploader"
           d:DesignWidth="1024" d:DesignHeight="1800" MaxWidth="1024"
           Title="VirtualInstallMachines Page">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="10" />
            <RowDefinition Height="333*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250" />
            <ColumnDefinition Width="550*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Margin="10" Name="panelTitle">
            <TextBlock Text="Testing Environment" Name="txtHeader"  FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" />
        </StackPanel>
        <StackPanel Grid.Row="1" Name="panelLandingNav" Margin="10,10,10,0" Background="#FF484848" Height="Auto" VerticalAlignment="Top" Width="200" HorizontalAlignment="Center">
            <HyperlinkButton x:Name="linkHome" NavigateUri="/Home" TargetName="ContentFrame" Content="Dashboard" Style="{StaticResource LinkStyle}" Background="{x:Null}" AllowDrop="True" HorizontalContentAlignment="Left" Margin="16,0,0,0"/>
            <controlsToolkit:Expander ExpandDirection="Down" Name="expanderRequest" Visibility="Visible" IsExpanded="True">
                <controlsToolkit:Expander.Header>
                    <TextBlock Text="Current Request" FontSize="12" Foreground="White" TextAlignment="Left" Name="expanderHeader" />
                </controlsToolkit:Expander.Header>
                <controlsToolkit:Expander.Content>
                    <StackPanel HorizontalAlignment="Right" Margin="30,0,0,0" Width="AUTO">
                        <HyperlinkButton x:Name="linkTestingDetails" NavigateUri="/Request/TestingDetails" TargetName="ContentFrame" Content="• Testing Environment" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Visible" Foreground="#FF42A1F5" />
                        <HyperlinkButton x:Name="linkPackageDetails" NavigateUri="/Request/PackageDetails" TargetName="ContentFrame" Content="• Package Details" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Collapsed" />
                        <HyperlinkButton x:Name="linkLicensingDetails" NavigateUri="/Request/Licensing" TargetName="ContentFrame" Content="• Licensing Details" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Collapsed" />
                        <HyperlinkButton x:Name="linkSummaryDetails" NavigateUri="/Request/RequestSummary" TargetName="ContentFrame" Content="• Request Summary" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Collapsed" />
                    </StackPanel>
                </controlsToolkit:Expander.Content>
            </controlsToolkit:Expander>
        </StackPanel>
        <StackPanel Name="panelContent" Grid.Row="1" Grid.Column="1" Visibility="Collapsed">
            <controlsToolkit:BusyIndicator Name="busyIndicatorTesting" IsBusy="False">
                <StackPanel>
                    <StackPanel Name="stackPanel1" Margin="10">
                        <Image Name="image" Source="/GranitePackageSystem;component/Assets/Resources/ProvisionVDI.png" />
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Height="25" Margin="0,0,0,20">
                            <TextBlock Text="Virtual Machine Name:  " Height="17" VerticalAlignment="Center" />
                            <TextBlock Name="blockVMName" Text="" Height="17" VerticalAlignment="Center" />
                        </StackPanel>
                        <GranitePackageSystem_FileUploader:FileUploaderControl x:Name="fileUploader" UploadHandlerPath="~/UploaderControlHandler.ashx" Height="250" Loaded="fileUploader_Loaded" IsEnabled="False" FileFilter="Zip Files(*.zip)|*.zip" UploadStarted="fileUploader_UploadStarted" />
                        <StackPanel Orientation="Vertical" Name="panelUploadedFiles" Visibility="Collapsed">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Source Files Successfully Uploaded" Width="200" VerticalAlignment="Center" />
                                <Button Content="Change Source Files" Click="btnChangeSourceFiles_Click" Name="btnChangeSourceFiles" Margin="10" Width="125" />
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Name="panelExeBrowser" Visibility="Collapsed">
                            <controlsToolkit:BusyIndicator Name="busyIndicatorExeBrowser" IsBusy="True" BusyContent="Reading Uploaded Source Files">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" Width="400">
                                            <StackPanel Margin="5">
                                                <TextBlock Text="Folder Browser" HorizontalAlignment="Center" />
                                                <sdk:TreeView Name="treeViewFolerList" >
                                                    <sdk:TreeView.ItemTemplate>
                                                        <sdk:HierarchicalDataTemplate x:Name="FolderName" ItemsSource="{Binding ChildSourceFolderNodes}">
                                                            <StackPanel Orientation="Horizontal">
                                                                <Image Margin="0,0,4,0" Source="/GranitePackageSystem;component/Assets/Resources/folder.png" MaxHeight="32" MaxWidth="32" />
                                                                <TextBlock Text="{Binding DisplayName}" Margin="5,0" />
                                                            </StackPanel>
                                                        </sdk:HierarchicalDataTemplate>
                                                    </sdk:TreeView.ItemTemplate>
                                                </sdk:TreeView>
                                            </StackPanel>
                                        </ScrollViewer>
                                        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" Width="350">
                                            <StackPanel Orientation="Vertical" Margin="5">
                                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                                    <TextBlock Text="Files in " />
                                                    <TextBlock Text="{Binding SelectedItem.DisplayName, ElementName=treeViewFolerList}" HorizontalAlignment="Center" />
                                                </StackPanel>
                                                <ListBox x:Name="FileList" Height="300" ItemsSource="{Binding SelectedItem.Files, ElementName=treeViewFolerList}">
                                                    <ListBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <TextBlock Text="{Binding DisplayName}" />
                                                        </DataTemplate>
                                                    </ListBox.ItemTemplate>
                                                    <ListBox.ItemContainerStyle>
                                                        <Style TargetType="ListBoxItem">
                                                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                                        </Style>
                                                    </ListBox.ItemContainerStyle>
                                                </ListBox>
                                            </StackPanel>
                                        </ScrollViewer>                                    
                                    </StackPanel>
                                        <Button Content="Set as Executable" Width="150" Name="btnSetExecutable" Click="btnSetExecutable_Click" />
                                </StackPanel>
                            </controlsToolkit:BusyIndicator>
                        </StackPanel>
                        <StackPanel Name="panelExeSelected" Visibility="Collapsed">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Executable Successfully Chosen" Width="200" VerticalAlignment="Center" />
                                <Button Content="Change Executable" Margin="10" Width="125" Name="btnChangeExecutable" Click="btnChangeExecutable_Click" />
                            </StackPanel>
                            <TextBlock Name="txtExePath" VerticalAlignment="Center" FontWeight="Bold" Margin="0,10,0,0" />
                        </StackPanel>
                        <Button Content="Deploy Files to VM" Name="btnDeployFiles" Margin="5" Width="170" Height="20" VerticalAlignment="Center" IsEnabled="False" Click="btnDeployFiles_Click" />
                        <StackPanel Orientation="Horizontal" Name="panelDeployedFiles" Visibility="Collapsed">
                            <TextBlock Text="Successfully Deployed Files" Width="200" VerticalAlignment="Center" />
                            <Button Content="Re-Deploy Files" Margin="10" Width="125" Name="btnRedeployFiles" Click="btnDeployFiles_Click" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </controlsToolkit:BusyIndicator>
        </StackPanel>
        <Border BorderBrush="Silver" BorderThickness="1" Grid.RowSpan="4" Grid.ColumnSpan="3" Name="border1">
            
        </Border>
    </Grid>
</navigation:Page>

